<h1>Listing products</h1>

<table  cellpadding="5" cellspacing="0">
  <tr>
      <% for column in Product.content_columns %>
        <th><%= column.human_name %></th>
      <% end %>
  </tr>

<% for product in @products %>
  <tr  valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>">
    <% for column in Product.content_columns %>
      <td><%= h product.send(column.name)%> </td>
    <% end %>
    <td  class="list-actions"><%= link_to 'Show', product %></td>
    <td  class="list-actions"><%= link_to 'Edit', edit_product_path(product) %></td>
    <td  class="list-actions"><%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New product', new_product_path %>
